package com.sgolub.commanndsonline.service.entity;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sgolub.commanndsonline.dao.entity.AdvertisingRegistryDAO;
import com.sgolub.commanndsonline.domain.entity.AdvertisingRegistry;

@Service
public class AdvertisingRegistryServiceImpl implements AdvertisingRegistryService {

	@Autowired
	private AdvertisingRegistryDAO advertisingRegistryDAO;
	
	@Transactional
	public AdvertisingRegistry get(Integer id) {
		return advertisingRegistryDAO.get(id);
	}

	@Transactional
	public AdvertisingRegistry	getItemByInventarNr(String inventarNr){
		return advertisingRegistryDAO.getItemByInventarNr(inventarNr);
	}
	
	@Transactional
	public void add(AdvertisingRegistry advertisingRegistry) {
		advertisingRegistryDAO.add(advertisingRegistry);
	}

	@Transactional
	public void update(AdvertisingRegistry advertisingRegistry) {
		advertisingRegistryDAO.update(advertisingRegistry);
	}

	@Transactional
	public void remove(Integer id) {
		advertisingRegistryDAO.remove(id);
	}

	@Transactional
	public List<AdvertisingRegistry> list() {
		return advertisingRegistryDAO.list();
	}

	@Transactional
	public List<AdvertisingRegistry> filter() {
		return advertisingRegistryDAO.list();
	}

	@Transactional
	public List<AdvertisingRegistry> advansedListWithPaginationFlexGrid(int rp, String sortorder, int page, String query, String sortname, String qtype ) {
		return advertisingRegistryDAO.advansedListWithPaginationFlexGrid(rp, sortorder, page, query, sortname, qtype);
	}
	
	@Transactional
	public List<AdvertisingRegistry> advansedListWithPaginationJQGrid(int rowsPerPage, int currentPage, String sortByColumn, String sortMode, HashMap<String, String> filtersMap) 
	{
		System.out.println("== AdvertisingRegistryServiceImpl.advansedListWithPaginationJQGrid ==");
		return advertisingRegistryDAO.advansedListWithPaginationJQGrid(rowsPerPage, currentPage, sortByColumn, sortMode, filtersMap);
	}	
	
}
